export default {
    has (node, class_name) {
        return node.classList.contains(class_name);
    },

    parent (node, class_name) {
        if (this.has(node, class_name)) return node;

        while (node.parentNode) {
            node = node.parentNode;
            if (this.has(node, class_name)) return node;
        }

        return null;
    }
}
